
import {createRouter,createWebHistory} from 'vue-router'
import home from '../components/home.vue'
``
//定义组件 定义路由
const routes = 	[
	//定义一级路由
	{
		name:'home',
		path:'/',
		component: home,
		meta:'主页',
		redirect:'/showLog',
		children:[
			{
                path: '/showLog',
                name:'showLog',
                component:()=>import('../components/showLog.vue'),
            },
            {
				name:'UDPsender',
				path:'/UDPsender',
				component:()=>import('../components/UDPsender.vue'),
				meta:'发送方'
			},
            {
                path: '/acceptor',
                name:'acceptor',
                component:()=>import('../components/acceptor.vue'),
            }
        ]
    }
]

//创建Router路由实例
const router = createRouter({
	history:createWebHistory(),//取出路由中的#号
	routes
})


// 给路由实例定义一个对外的应用（注入路由）
export default router